<%- include('../layouts/head.ejs', { pageConf })%>

<div class="container">
  
  <%- include('../common/user_nav.ejs', { commonPageConf })%>

  <!-- 轮播图部分 -->
  <section class="slider-wrap">
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <% for(var i = 0; i < pageConf.swiper_img.length; i++) { %>
        <div class="swiper-slide">
          <img src="<%= pageConf.swiper_img[i] %>" alt="<%= pageConf.swiper_title[i]  %>">
        </div>
        <% } %>
      </div>
      <!-- 如果需要分页器 -->
      <div class="swiper-pagination"></div>
    </div>
  </section>


  <section>
    <div class="top-wrap clearfix">

      <!-- 网站公告 -->
      <div class="notify-wrap">
        <div class="list-title">
          <h1><%= pageConf.notify_title%></h1>
        </div>

        <div class="notify-nav">
          <ul class="notify-nav-list clearfix">
            <li class="list-item">
              最新
            </li>
            <li class="list-item">
              公告
            </li>
            <li class="list-item">
              新闻
            </li>
            <li class="list-item">
              活动
            </li>
          </ul>
        </div>

        <ul class="list active" data-field="last_news">
          <li class="list-item">
            <div class="tag">
              公告
            </div>
            <div class="content">
              算法推荐平台使用指南
            </div>
            <div class="time">
              4/27
            </div>
          </li>
        </ul>

        <ul class="list" data-field="notifycation">
          <li class="list-item">
            <div class="tag">
              公告
            </div>
            <div class="content">
              公告内容
            </div>
            <div class="time">
              发布时间
            </div>
          </li>
        </ul>

        <ul class="list" data-field="news">
          <li class="list-item">
            <div class="tag">
              公告
            </div>
            <div class="content">
              公告内容
            </div>
            <div class="time">
              发布时间
            </div>
          </li>
        </ul>

        <ul class="list" data-field="activity">
          <li class="list-item">
            <div class="tag">
              公告
            </div>
            <div class="content">
              公告内容
            </div>
            <div class="time">
              发布时间
            </div>
          </li>
        </ul>

        
        <!-- <table class="layui-table">
          <thead>
            <tr>
              <% pageConf.ranking_head.forEach((item, index)   => { %>
              <th class="ranking-th"><%= item %></th>
              <% }) %>
            </tr>
          </thead>
          <tbody>

            <% rankingList.forEach((item, index) => { %>
            <tr>
              <td class="problem-td"><%= index + 1 %></td>
              <td class="problem-td"><%= item.user_name %></td>
              <td class="problem-td"><%= item.pass_times %></td>
              <td class="problem-td"><%= item.online_time %>小时</td>
              <td class="problem-td"><%= item.regist_time %></td>
            </tr>
            <% }) %>
          </tbody>
        </table> -->
      </div>

      <!-- 用户排名 -->
      <div class="ranking-wrap">
        <div class="ranking-title">
          <div class="list-title">
            <h1><%= pageConf.ranking_title%></h1>
          </div>
          <table class="layui-table">
            <!-- <colgroup>
            <col width="">
            <col width="">
            <col>
          </colgroup> -->
            <thead>
              <tr>
                <% pageConf.ranking_head.forEach((item, index) => { %>
                <th class="ranking-th"><%= item %></th>
                <% }) %>
              </tr>
            </thead>
            <tbody>

              <% rankingList.forEach((item, index) => { %>
              <tr>
                <td class="problem-td"><%= index + 1 %></td>
                <td class="problem-td"><%= item.user_name %></td>
                <td class="problem-td"><%= item.pass_times %></td>
                <td class="problem-td"><%= item.online_time %>小时</td>
                <td class="problem-td"><%= item.regist_time %></td>
              </tr>
              <% }) %>
            </tbody>
          </table>
        </div>
      </div>

      
    </div>
    </div>

    <!-- 题目部分 -->
    <div class="problem-wrap">
      <div class="list-title">
        <h2><%= pageConf.problem_wrap_title%></h2>
      </div>
      <table class="layui-table">
        <!-- <colgroup>
          <col width="">
          <col width="">
          <col>
        </colgroup> -->
        <thead>
          <tr>
            <% pageConf.problem_head.forEach((item, index) => { %>
            <th class="problem-th"><%= item %></th>
            <% }) %>
          </tr>
        </thead>
        <tbody>

          <% problemList.forEach((item, index) => { %>
          <tr>
            <td class="problem-td">
              <a href="/problem-detail/<%= item.pid%>" target="_blank" rel="noopener noreferrer">
                <%= item.pid %>
              </a>
            </td>
            <td class="problem-td">
              <a href="/problem-detail/<%= item.pid%>" target="_blank" rel="noopener noreferrer">
                <%= item.title %>
              </a>
            </td>
            <td class="problem-td"><%= item.type %></td>
            <td class="problem-td"><%= item.difficulty %></td>
            <td class="problem-td"><%= item.submit_times %></td>
            <td class="problem-td"><%= item.submit_times === 0 ? '50' : item.pass_times / item.submit_times * 100 %>%</td>
          </tr>
          <% }) %>
        </tbody>
      </table>
    </div>

  </section>



</div>

<%- include('../layouts/foot.ejs', { pageConf })%>